package com.yue.design.composite;

/**
 * 组合模式
 */
public class Test {
    public static void main(String[] args) {
        MyFolder first = new MyFolder("d",1);
        MyFolder sec1 = new MyFolder("docker",2);
        MyFolder sec2 = new MyFolder("soft",2);
        first.add(sec1);first.add(sec2);
        MyFile f1 = new MyFile("robot1");
        MyFile f2 = new MyFile("ubuntu1");
        MyFile f3 = new MyFile("redis");
        MyFile f4 = new MyFile("mysql");
        MyFile f5 = new MyFile("nacos");
        MyFile f6 = new MyFile("ffmpeg");
        sec1.add(f1);sec1.add(f2);sec1.add(f6);
        sec2.add(f3);sec2.add(f4);sec2.add(f5);
        first.show();
    }
}
